package Ptolemaiosz;


import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;



public class TextureManager {
	protected static BufferedImage wallTexture;
	protected static BufferedImage levelPartTexture;
	protected static BufferedImage levelTexture;
	protected static BufferedImage doorTexture;
	protected static BufferedImage avatarTexture;
	protected static BufferedImage collectedKeyTexture;
	protected static BufferedImage uncollectedKeyTexture;

	public static void loadTexture() {
		try {
	           avatarTexture = ImageIO.read(new File("images/avatar.png"));
	           uncollectedKeyTexture = ImageIO.read(new File("images/key.png"));
	           collectedKeyTexture = ImageIO.read(new File("images/key_collected.png"));
	           doorTexture = ImageIO.read(new File("images/door.png"));
	           wallTexture = ImageIO.read(new File("images/wall_texture.png"));
	           levelPartTexture = ImageIO.read(new File("images/background.png"));
	           levelTexture = ImageIO.read(new File("images/background_full.png"));
	           
	           } catch (IOException e) {
	       }
		
	}

	public static BufferedImage getTexture(String id) {
		if(id.equals("wall"))
		{
			return wallTexture;
		}
		if(id.equals("levelPart"))
		{
			return levelPartTexture;
		}
		if(id.equals("level"))
		{
			return levelTexture;
		}
		if(id.equals("door"))
		{
			return doorTexture;
		}
		if(id.equals("avatar"))
		{
			return avatarTexture;
		}
		if(id.equals("collectedKey"))
		{
			return collectedKeyTexture;
		}
		if(id.equals("uncollectedKey"))
		{
			return uncollectedKeyTexture;
		}
		return null;
	}
}